﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace RegularExpression
{
    class EmailExtraction
    {
        //private static 

        static void Main(string[] args)
        {

            string text = "This is a example test for e-mail extraction: test@abv.bg, ; da te-st@mest.co.uk";
            string pattern = @"\b[a-zA-Z0-9_\.\-]+(@){1}[a-zA-Z_\-\.]+([a-zA-Z]{2,4})+\b";

            MatchCollection result = Regex.Matches(text, pattern);
            foreach (var item in result)
            {
                Console.WriteLine(item);
            }
        }
    }
}
